﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccessLayer;
using DataAccessLayer.DAL;
using Common;

namespace BestBuy
{
    public partial class UserView : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            User user = UserDAL.GetUserByUsername(HttpContext.Current.User.Identity.Name);
            if (user != null)
            {
                if (user.RoleID == (int)RoleType.Buyer)
                {
                    pnBuyer.Visible = true;
                }
                else if (user.RoleID == (int)RoleType.Seller)
                {
                    pnSeller.Visible = true;
                }
            }
        }
    }
}